package com.slz3.business.module.wmsManagement.wmsTraysManage.steward;

import com.slz3.business.module.wmsManagement.wmsTraysManage.domain.WmsTraysManage;
import com.slz3.business.module.wmsManagement.wmsTraysManage.domain.WmsTraysManageCondition;
import org.reactivestreams.Publisher;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;

@Component
public class WmsTraysManageResponse extends WmsTraysManageResController {

    public Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(WmsTraysManage.class).flatMap(wmsTraysManage ->
                super.add(req, wmsTraysManage)
        );
    }

    public Mono<ServerResponse> batchAdd(ServerRequest req) {
        return req.bodyToFlux(WmsTraysManage.class)
                .collectList()
                .flatMap(wmsTraysManages -> super.batchAdd(req, wmsTraysManages));
    }

    public Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(WmsTraysManageCondition.class).flatMap(wmsTraysManageCondition ->
                super.delete(req, wmsTraysManageCondition)
        );
    }

    public Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(WmsTraysManage.class).flatMap(wmsTraysManage ->
                super.modify(req, wmsTraysManage)
        );
    }


    public Mono<ServerResponse> list(ServerRequest req) {
        return super.list(req);
    }

    public Mono<ServerResponse> info(ServerRequest req) {
        return super.info(req);
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        return super.choice(req);
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(WmsTraysManageCondition.class).flatMap(wmsTraysManageCondition ->
                super.auditSubmit(req, wmsTraysManageCondition)
        );
    }

    public Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(WmsTraysManageCondition.class).flatMap(wmsTraysManageCondition ->
                super.audit(req, wmsTraysManageCondition)
        );
    }

    public Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(WmsTraysManageCondition.class).flatMap(wmsTraysManageCondition ->
                super.auditReject(req, wmsTraysManageCondition)
        );
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(WmsTraysManageCondition.class).flatMap(wmsTraysManageCondition ->
                super.usingEnable(req, wmsTraysManageCondition)
        );
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(WmsTraysManageCondition.class).flatMap(wmsTraysManageCondition ->
                super.usingDisable(req, wmsTraysManageCondition)
        );
    }

}
